#!/usr/bin/env python
#
#--*-- encoding:UTF-8 --*--
#
import os
import re

AllVersion = ['alpha','beta','staging','gamma','delta']
ConfigFilePath = '/opt/nginx/conf/vhosts'

def PatternExists(filename,pattern):
	"if  pattern can be founded in filename, print that line."

	with open(filename) as openfile:
		content = openfile.readlines()
		for each_line in content:
			if re.findall(pattern, each_line):
				print filename +" ## "+ each_line 

#PatternExists('/etc/passwd','root')

os.chdir(ConfigFilePath)

for each_file in os.listdir(ConfigFilePath):
	for each_item in AllVersion:
		if re.findall(each_item,each_file):
			continue
		else:
			PatternExists(each_file,each_item)